<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 
<!DOCTYPE html>
<html>
	<head>
		<%@ include file="/view/common/header.jsp"%> 
		<link rel="stylesheet" href="${ctx}/css/lipe.css"/>
<link rel="stylesheet" href="${ctx}/js/slide/slide.css" />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>用户管理</title>
		<script type="text/javascript">
			//查询
			function search(){
				$('#dg').datagrid('load',{
					    usertype:$("#usertype").combobox("getValue"),
					    phone:$("#phone").val(),
					    realname:$("#realname").val(),
					    status:$("#status").combobox("getValue")
				});
			}
			
			$(document).ready(function(){
				 $("#dg").datagrid({
					  "onDblClickRow" : function(index, row){
						  $.ajax({
							  url: root +'/customer/getCustomerById.do',
							  data: {id:row.customerid },
							  success:function(res){
									window.parent.openTabBackGround('设计师详情',  'customer/goDesignerDetail.do?id=' +row.customerid  ,   'icon-khgcfx');
// 		 						   $("#dlg").dialog("open").dialog("setTitle",'设计师详情');
// 		 						   $('#fm').form('myLoad',res); 
							  },error:function(res){
								   $.messager.alert("系统提示","获取数据失败"); 
							  }
						  })
					 }
				  });
			 
			});
			
			 function typeFormatter( value, row){
				 	if("1" == row.usertype){
					    return "普通用户";
					}
				 	if("2" == row.usertype){
					    return "设计师";
					}
					return "普通用户";
			 }
			 
			 function statusFormatter( value, row){
				  
				 	if("1" == row.status){
					    return "未认证";
					}
				 	if("2" == row.status){
					    return "待审核";
					}
				 	if("3" == row.status){
					    return "已认证";
					}
					return "未认证";
			 }
		</script>
	</head>
<body style="margin:1px;">
	<!-- 工具栏  -->
	<div id="tb">
		<form id="searchfm" >
<!-- 		<div> -->
<!-- 			<a href="javascript:openAddDialog()" class="easyui-linkbutton" iconCls="icon-add" plain="true">新增</a> -->
<!-- 			<a href="javascript:openModifyDialog()" class="easyui-linkbutton" iconCls="icon-edit" plain="true">修改</a> -->
<!-- 			<a href="javascript:disableRoles()" class="easyui-linkbutton" iconCls="icon-remove" plain="true">删除</a> -->
<!-- 		</div> -->
	 
	
	 
		<div>
			&nbsp;姓名：&nbsp;<input type="text" id="realname" size="20"  /> &nbsp;
			&nbsp;手机号：&nbsp;<input type="text" id="phone"  size="20" />&nbsp;
			&nbsp;认证状态：&nbsp; 
			                     <select  id="status" size="20"  class="easyui-combobox" data-options="width:100">
										 <option value="" selected="selected">--请选择--</option>  
										 <option value="1"  >未认证</option>
									     <option value="2"  >待审核</option> 
									     <option value="3"  >已认证</option> 
								</select>&nbsp;
								
			&nbsp;用户类型：&nbsp; 
			  <select  id="usertype" size="20"  class="easyui-combobox" data-options="width:100">
										 <option value="" selected="selected">--请选择--</option>  
										 <option value="1"  >普通用户</option>
									     <option value="2"  >设计师</option> 
								</select>&nbsp;
								
			<a href="javascript:search()" class="easyui-linkbutton" iconCls="icon-search" plain="true">搜索</a>
		    <a href="javascript:resetSearchForm()" class="easyui-linkbutton" iconCls="icon-arrow_undo" plain="true">重置</a>
		</div>
	 </form>	
	</div>
	
	<!-- 查询表单 --> 
	<table id="dg" title="用户管理" class="easyui-datagrid"  pagination="true" rownumbers="true"  fit="true"  url="../customer/queryForPage.do"  toolbar="#tb">
		 <thead>
				<tr>
					<th data-options="field:'customerid',width:100" align="center">用户ID</th>
  							<th data-options="field:'realname',width:100" align="center">姓名</th>
							<th data-options="field:'phone',width:100" align="center">手机号</th>
							<th data-options="field:'profile',width:100" align="center">个人简介</th>
							<th data-options="field:'orgname',width:100" align="center">所属设计公司</th>
							<th data-options="field:'x',width:100,formatter:typeFormatter" align="center">用户类型</th>
							<th data-options="field:'y',width:100,formatter:statusFormatter" align="center">认证状态</th>
				</tr>
		</thead>
	</table>
	 
	 
</body>
</html>